package demo.collidingSpheres;

import static org.lwjgl.opengl.GL11.*;

import org.lwjgl.util.glu.Sphere;

import engine.collider.bounds.BoundingSphere;
import engine.gameObject.GameObject;

public class StaticSphere extends GameObject{
	private Sphere sphere;
	private float radius;
	
	public StaticSphere(float radius) {
		this.radius = radius;
		
		//set the radius of the object for frustum culling
		setBounds(0, 0, 0, radius);
		
		//set the bounding element
		BoundingSphere bounds = new BoundingSphere();
		bounds.setRadius(radius);
		addBoundingElement(bounds);
		
		sphere = new Sphere();
	}
	
	@Override
	public void render(float timeElapsed) {
		glColor3f(1, 0, 0);
		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
		
		sphere.draw(radius, 50, 50);
		
		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
	}
}
